const { getSongSheetAjax } = require("@/http/modules/songsheet");
const { createSlice, createAsyncThunk } = require("@reduxjs/toolkit");

export const getSongSheetInfo = createAsyncThunk("songsheet",async (cat = '全部')=>{
    const res = await getSongSheetAjax(cat)
    return res
})

const songSheet = createSlice({
    name:"songSheet",
    initialState:{
        songSheet:[]
    },
    extraReducers:{
        [getSongSheetInfo.fulfilled](state,{payload}){
            state.songSheet = payload
        }
    }
})

export default songSheet.reducer